package cn.tedu._04mybatis.mapper;

import cn.tedu._04mybatis.pojo.*;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface WeiboMapper {
   /* @Insert("insert into weibo(content,created,user_id) " +
            "values (#{content},#{created},#{userId})")*/
    int insert(Weibo weibo);
    /*@Delete("delete from weibo " +
            "where id = #{id}")*/
    int deleteById(Integer id);
   /* @Update("update weibo set content=#{content},created=#{created},user_id=#{userId} " +
            "where id =#{id}")*/
    int updateById(Weibo weibo);
    /*@Select("select id,content,created,user_id as userId " +
            "from weibo " +
            "where id = #{id}")*/
    Weibo selectById(Integer id);
    /*@Select("select id,content,created,user_id as userId " +
            "from weibo")*/
    List<Weibo> selectAll();
    /*@Select("select content,created " +
            "from weibo " +
            "where id = #{id}")*/
    WeiboVO1 selectByIdVO1(Integer id);
    @Select("select content,created,user_id as userId " +
            "from weibo")
    List<WeiboVO2> selectAllVO2();

    int dynamicUpdate(Weibo weibo);

    int dynamicDelete(Integer[] ids);

    int countWeibo();

    WeiboVO3 selectByIdWeiboVO3(Integer id);

    List<WeiboVO3> selectAllWeiboVO3();





}
